<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script type="text/javascript" src="../script/jquery-3.6.0.min.js"></script>
  <script type="text/javascript">
    window.onload = function () {
      var username = document.getElementById("username");
      if(username){
        alert("username value=" + username.value)
      }else {
        alert("没有获取到对应id的dom对象")
      }

      var $username = $("#username");
      alert($username.val())
    }
  </script>
</head>
<body>

</body>
</html>
